package com.inphase.myfood_client.activity;

import android.app.Activity;
import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;

import com.inphase.myfood_client.util.HttpUtils;

public class MainActivity extends Activity {
	private String tag = "MainActivity";
	
	public void executeGetMethod(){
		String ip = "http://192.168.0.124:8080";
		String url = ip + "/myfood-server/dash/list.do";
		Log.e(tag, "---->" + HttpUtils.getJsonObject(url).toString());
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		//###### 使得在主线程里面可以调用连接网络获取数据的方法  ########
		StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
				.penaltyLog().build());
		StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
				.detectLeakedSqlLiteObjects().penaltyLog().penaltyDeath()
				.build());
		//###### 使得在主线程里面可以调用连接网络获取数据的方法  ########
		
		executeGetMethod();
	}
}
